<template>
	<view>
		<web-view :src="'https://webapp.test.shenghua6.cn/st/app/member/index3.html?userId='+userId+'&tk='+tk" @message="handleMessage"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userId: '',
				tk: ''
			}
		},
		onShow() {
			var that = this
			uni.getStorage({
				key: 'userInfo',
				success: function(res) {
					that.userId = res.data.userId
					that.getwebtk()
				},
				fail: function(res) {
					that.tk = ''
				}
			});
		},
		methods: {
			getwebtk() {
				var data = {
					url: '/web/nv1/auth/getwebtk',
					methods: 'post',
					data: {
						userId: this.userId
					}
				}
				this.$http(data).then(res => {
					this.tk = res.data.data.tk
				})
			},
			handleMessage(evt) {
				console.log('接收到的消息：' + JSON.stringify(evt.detail.data));
			}
		},
		mounted: function() {

		}
	}
</script>

<style lang="scss" scoped>
	// @import './style/members.css';
</style>
